#!/usr/bin/env python
"""reducer.py"""

from operator import itemgetter
import sys

total_count = 0
ip = None

# input comes from STDIN
for line in sys.stdin:
    # remove leading and trailing whitespace
    line = line.strip()

    # parse the input we got from mapper.py
    ip, count = line.split('\t', 1)

    # convert count (currently a string) to int
    try:
        count = int(count)
    except ValueError:
        # count was not a number, so silently
        # ignore/discard this line
        continue

    total_count = total_count + count

print '%s' % (total_count)